package com.zzl.bonds.ticket.constant;

/**
 * 页面状态样式枚举值
 *
 * @author szsw
 * @date 2021/12/13 14:28:30
 */
public enum StyleEnum {

    /**
     *ele-text-success 成功色(绿色)
     * ele-text-warning 警告色(黄色)
     * ele-text-danger 危险色(红色)
     * ele-text-info 信息色(灰色)
     */
    STYLE_SIMPLE            (1,"#333333", "","无特殊情况"),
    STYLE_RED               (2,"ele-text-danger", "#FDEDEC","红色，失败"),
    STYLE_GREEN             (3,"ele-text-success", "#F1FEEA","绿色，成功"),
    STYLE_BLUE              (4,"ele-text-primary", "#0A77FF","蓝色，进行中"),
    STYLE_GRAY              (5,"ele-text-info", "#EBEEF1","灰色，锁定"),
    STYLE_YELLOW            (6,"ele-text-warning", "#FFF6E0","黄色，异常"),
    ;

    private Integer code;
    private String fontColor;
    private String bkColor;
    private String description;

    StyleEnum(Integer code, String fontColor, String bkColor, String description) {
        this.code = code;
        this.fontColor = fontColor;
        this.bkColor = bkColor;
        this.description = description;
    }

    /**
     * 通过code获取枚举值
     *
     * @param code code
     * @return 枚举值
     */
    public static StyleEnum getEnum(Integer code) {
        for (StyleEnum value : StyleEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public String getFontColor() {
        return fontColor;
    }

    public String getBkColor() {
        return bkColor;
    }

    public String getDescription(){
        return description;
    }

    public Integer getCode() {
        return code;
    }
}
